package com.park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.park.entity.Park;
import com.park.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT * FROM user where user_car_id like concat('%', #{id}, '%') LIMIT #{start},#{end}")
    List<User> getByUserCarId(@Param("id") String id,@Param("start") int start,@Param("end")int end);

    @Select("SELECT COUNT(1) FROM user where user_car_id like concat('%', #{id}, '%')")
    int getPage(@Param("id") String id);

    @Select("SELECT * FROM user where user_phone=#{userphone}")
    User selectByPone(@Param("userphone") String userphone);
}
